<template>
    <div class="edu-page-warp">
        <ConditionCard
            shadow="never"
            body-style="padding: 24px 24px 6px 24px;"
            @search="onSubmit"
            @reset="reset('queryForm')"
        >
            <el-form ref="queryForm" :model="queryForm" label-position="right" label-width="120px">
                <el-row :gutter="24" style="height: 50px;">
                    <el-col :span="8">
                        <el-form-item
                            :label="$t('graduationList.originalGraduationYear') + ':'"
                            prop="graduationDate"
                        >
                            <el-date-picker
                                v-model="queryForm.graduationDate"
                                type="year"
                                style="width:100%"
                                value-format="yyyy"
                                @change="getFacultyList"
                                :placeholder="$t('graduationList.pleaseSelect')"
                            ></el-date-picker>
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item
                            :label="$t('graduationList.compeleteGraduationYear') + ':'"
                            prop="graduationDate"
                        >
                            <el-date-picker
                                v-model="extraParam.reviewDate"
                                type="year"
                                style="width:100%"
                                value-format="yyyy" 
                                clearable
                                @change="graduationDateChange"
                                :placeholder="$t('graduationList.pleaseSelect')"
                            ></el-date-picker>
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item
                            :label="$t('graduationList.auditBatch') + ':'"
                            prop="reviewBatch"
                        >
                            <el-select v-model="queryForm.reviewBatch" filterable clearable style="width: 100%">
                                <el-option
                                    v-for="item in options.reviewBatch"
                                    :key="item.value"
                                    :label="item.label"
                                    :value="item.value"
                                />
                            </el-select>
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item :label="$t('label.college') + ':'" prop="faculty">
                            <el-select
                                v-model="queryForm.faculty"
                                style="width: 100%;"
                                :filterable='role != 3' 
                                :clearable='role !=3'
                                @change="getMajorOptions"
                            >
                                <el-option
                                    v-for="item in options.faculty"
                                    :key="item.value"
                                    :label="item.label"
                                    :value="item.value"
                                />
                            </el-select>
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item filterable :label="$t('graduationList.trainingProfessional') + ':'" prop="profession">
                            <el-select v-model="queryForm.profession" filterable clearable style="width: 100%">
                                <el-option
                                    v-for="item in options.profession"
                                    :key="item.value"
                                    :label="item.label"
                                    :value="item.value"
                                />
                            </el-select>
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item
                            filterable
                            :label="$t('graduationList.nation') + ':'"
                            prop="nation"
                        >
                            <el-select v-model="queryForm.nation" filterable clearable style="width: 100%">
                                <el-option
                                    v-for="item in options.nation"
                                    :key="item.value"
                                    :label="item.label"
                                    :value="item.value"
                                />
                            </el-select>
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item filterable :label="$t('graduationList.sex') + ':'" prop="sex">
                            <el-select v-model="queryForm.sex" clearable style="width: 100%">
                                <el-option
                                    v-for="item in options.sex"
                                    :key="item.value"
                                    :label="item.label"
                                    :value="item.value"
                                />
                            </el-select>
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item
                            filterable
                            :label="$t('graduationList.schoolSystem') + ':'"
                            prop="lengthSchooling"
                        >
                            <el-select
                                v-model="queryForm.lengthSchoolingList"
                                clearable
                                multiple
                                collapse-tags
                                style="width: 100%"
                            >
                                <el-option
                                    v-for="item in options.lengthSchooling"
                                    :key="item.value"
                                    :label="item.label"
                                    :value="item.value"
                                />
                            </el-select>
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item
                            :label="$t('graduationList.graduationStartTime') + ':'"
                            prop="collegeReviewStartDate"
                        >
                            <el-date-picker
                                style="width: 100%;"
                                v-model="queryForm.collegeReviewStartDate"
                                value-format="yyyy-MM-dd HH:mm:ss"
                                format="yyyy-MM-dd"
                                type="date"
                                :placeholder="$t('graduationList.pleaseSelect')"
                                clearable
                            ></el-date-picker>
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item
                            :label="$t('graduationList.graduationEndTime') + ':'"
                            prop="collegeReviewEndDate"
                        >
                            <el-date-picker
                                style="width: 100%;"
                                v-model="queryForm.collegeReviewEndDate"
                                value-format="yyyy-MM-dd HH:mm:ss"
                                format="yyyy-MM-dd"
                                type="date"
                                :placeholder="$t('graduationList.pleaseSelect')"
                                clearable
                            ></el-date-picker>
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item
                            :label="$t('graduationList.IDNumber') + ':'"
                            prop="number"
                            class="no-bottom"
                        >
                            <el-input
                                v-model="queryForm.number"
                                clearable
                                :placeholder="$t('graduationList.pleaseInput')"
                            />
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item
                            :label="$t('graduationList.auditConclusionOfOriginalCollege') + ':'"
                            prop="orginManualConclusion"
                            class="no-bottom"
                        >
                            <el-select
                                v-model="queryForm.orginManualConclusion"
                                clearable
                                style="width: 100%"
                            >
                                <el-option
                                    v-for="item in options.collegeAuditConclusion"
                                    :key="item.value"
                                    :label="item.label"
                                    :value="item.value"
                                />
                            </el-select>
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item
                            filterable
                            :label="$t('graduationList.collegeAuditConclusion') + ':'"
                            prop="collegeAuditConclusion"
                        >
                            <el-select
                                v-model="queryForm.collegeAuditConclusion"
                                clearable
                                style="width: 100%"
                            >
                                <el-option
                                    v-for="item in options.collegeAuditConclusion"
                                    :key="item.value"
                                    :label="item.label"
                                    :value="item.value"
                                />
                                <el-option
                                    key="4"
                                    :label="$t('graduationList.permanentClosure')"
                                    value="4"
                                />
                            </el-select>
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item :label="$t('culturePlan.degreeType') + ':'" prop="degreeType">
                            <el-select v-model="queryForm.degreeType" clearable style="width: 100%">
                                <el-option
                                    v-for="item in options.degreeType"
                                    :key="item.value"
                                    :label="item.label"
                                    :value="item.value"
                                ></el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>

                    <el-col :span="8">
                        <el-form-item
                            filterable
                            :label="$t('graduationList.isEffective') + ':'"
                            prop="isValidity"
                        >
                            <el-select clearable v-model="queryForm.isValidity" style="width: 100%">
                                <el-option
                                    v-for="item in options.validityList"
                                    :key="item.value"
                                    :label="item.label"
                                    :value="item.value"
                                />
                            </el-select>
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item
                            filterable
                            :label="$t('graduationList.submissionStatus') + ':'"
                            prop="submit"
                        >
                            <el-select v-model="queryForm.submit" clearable style="width: 100%">
                                <el-option
                                    v-for="item in options.submit"
                                    :key="item.value"
                                    :label="item.label"
                                    :value="item.value"
                                />
                            </el-select>
                        </el-form-item>
                    </el-col>
                </el-row>
            </el-form>
        </ConditionCard>
        <el-card shadow="never" body-style="padding: 24px;" class="card-margin">
            <h1 class="condition-title float-left" style="width:200px;margin-bottom: 12px;line-height: 30px;">
                {{ $t('graduationList.listOfGraduates') }}
            </h1>
            <div class="float-right btn-right-list" v-if="role == 4">
                <div class="clearfix">
                    <el-row style="float:right;margin-bottom:10px">
                        <el-button type="primary" @click="handleClick('EGRJ')">
                            {{ $t('graduationList.exportCertificateRenewalp') }}
                        </el-button>
                        <el-button type="primary" @click="handleClick('EGRX')">
                            {{ $t('graduationList.exportCertificateRenewalx') }}
                        </el-button>
                        <el-button type="primary" @click="handleClick('SCN')">
                            {{ $t('graduationList.setDegreeCertificateNumbere') }}
                        </el-button>
                        <el-button type="primary" @click="handleClick('EPC')">
                            {{ $t('graduationList.printDegreeCertificate') }}
                        </el-button>
                        <el-button type="primary" @click="handleClick('BSR')">
                            {{ $t('graduationList.degreeReport') }}
                        </el-button>
                        <el-button type="primary" @click="handleClick('SMCN')">
                            {{ $t('graduationList.setMinorProfessionalCertificateNumber') }}
                        </el-button>
                    </el-row>
                </div>
                <div class="clearfix">
                    <el-row style="float:right;">
                        <el-button type="primary" @click="handleClick('addRecord')">
                            {{$t('common.btn.add')}}
                        </el-button>
                        <el-button type="primary" @click="handleClick('EMF')">
                            {{ $t('graduationList.exportMinorFiles') }}
                        </el-button>
                        <el-button type="primary" @click="handleClick('PRF')">
                            {{ $t('graduationList.printReissueList') }}
                        </el-button>
                        <!-- <el-button type="info" @click="handleClick('WAC')">
                            {{ $t('graduationList.btn6') }}
                        </el-button> -->
                        <el-button type="info" @click="handleClick('SIE')">
                            {{ $t('graduationList.isSettingValid') }}
                        </el-button>
                    </el-row>
                </div>
            </div>
            <div class="div-main clearfix">
                <div style="width:190px">
                    <el-input
                        v-model="queryForm.name"
                        :placeholder="$t('graduationList.please')"
                        prefix-icon="el-icon-search"
                        @change="handleSearch"
                    />
                </div>
                <div style="float:right;margin-top: -32px;" v-if="showMinorBtnInRole3">
                    <el-button type="primary" @click="handleClick('SMCN')">
                        {{ $t('graduationList.setMinorProfessionalCertificateNumber') }}
                    </el-button>
                    <el-button type="primary" @click="handleClick('EMF')">
                        {{ $t('graduationList.exportMinorFiles') }}
                    </el-button>
                </div>
            </div>
            <EduTable
                :data="tableData"
                @page-change="handleCurrentChange"
                :total="queryForm.total"
                :pageSize="queryForm.pageSize_"
                :page-num="queryForm.pageNum_"
                :orderFixed='true'
                @selection-change="handleSelectionChange"
            >
                <el-table-column
                    :label="$t('graduationList.studentID')"
                    prop="studentId"
                    fixed
                ></el-table-column>
                <el-table-column :label="$t('graduationList.name')" prop="name" fixed></el-table-column>
                <el-table-column
                    :label="$t('label.college')"
                    prop="facultyI18n"
                    width="150"
                    fixed
                    show-overflow-tooltip
                ></el-table-column>
                <el-table-column
                    :label="$t('courseSummary.faculty')"
                    prop="faculty"
                    min-width="100"
                    show-overflow-tooltip
                ></el-table-column>
                <el-table-column
                    :label="$t('graduationList.trainingProfessional')"
                    prop="professionI18n"
                    min-width="150"
                    show-overflow-tooltip
                ></el-table-column>
                <el-table-column
                    :label="$t('graduationList.statusProfession')"
                    prop="statusProfessionName"
                    min-width="150"
                    show-overflow-tooltip
                ></el-table-column>
                <el-table-column
                    :label="$t('course.majorCode')"
                    prop="profession"
                    min-width="100"
                    show-overflow-tooltip
                ></el-table-column>
                <!-- <el-table-column :label="$t('auditStandard.proDirection')" prop="directionName" width="120" show-overflow-tooltip></el-table-column> -->
                <el-table-column
                    :label="$t('graduationList.nation')"
                    prop="nationI18n"
                ></el-table-column>
                <el-table-column
                    :label="$t('graduationList.IDNumber')"
                    prop="number"
                    width="170"
                    show-overflow-tooltip
                ></el-table-column>                              
                <el-table-column :label="$t('graduationList.sex')" prop="sexI18n"></el-table-column>
                <el-table-column
                    :label="$t('graduationList.traininglevel')"
                    prop="trainingLevelI18n"
                ></el-table-column>
                <el-table-column
                    :label="$t('graduationList.enrollmentDate')"
                    prop="enrolDate"
                    width="100"
                ></el-table-column>
                <el-table-column
                    width="100"
                    :label="$t('graduationList.originalGraduationYear')"
                    prop="graduationDate"
                ></el-table-column>
                <el-table-column
                    :label="$t('graduationList.principal')"
                    prop="principalName"
                ></el-table-column>
                <el-table-column
                    :label="$t('graduationList.birthday')"
                    prop="birthdayStr"
                    width="100"
                ></el-table-column>                
                <el-table-column
                    :label="$t('graduationList.schoolSystem')"
                    prop="lengthSchooling"
                ></el-table-column>
                <el-table-column
                    :label="$t('graduationList.failingCourse')"
                    prop="noPassCourse"
                    width="280"
                    show-overflow-tooltip
                ></el-table-column>
                <el-table-column
                    :label="$t('graduationList.certificateNo')"
                    prop="certificateNo"
                    width="170"
                    show-overflow-tooltip
                ></el-table-column>
                <el-table-column 
                    :label="$t('graduationList.minorProfessionalCertificate')" 
                    prop="minorCertificateNo" 
                    width="170" 
                    show-overflow-tooltip>
                </el-table-column>
                <el-table-column
                    :label="$t('graduationList.degreeCertificateNumber')"
                    prop="diplomaNo"
                    width="170"
                    show-overflow-tooltip
                ></el-table-column>
                <el-table-column
                    :label="$t('graduationList.remark')"
                    prop="manualRemark"
                    show-overflow-tooltip
                ></el-table-column>
                <el-table-column
                    :label="$t('graduationList.auditConclusionOfOriginalCollege')"
                    prop="orginManualConclusionI18n"
                    width="130"
                ></el-table-column>
                <el-table-column
                    :label="$t('graduationList.auditConclusionOfCollege')"
                    width="110"
                >
                    <template slot-scope="scope">
                       <span v-if="scope.row.collegeAuditConclusion == 4">{{$t('graduationList.permanentClosure')}}</span>
                       <span v-else>{{scope.row.collegeAuditConclusionI18n}}</span>
                    </template>
                </el-table-column>
                <el-table-column
                    :label="$t('graduationList.bachelorScience')"
                    prop="degreeI18n"
                    width='120'
                    show-overflow-tooltip
                ></el-table-column>
                <el-table-column
                    :label="$t('graduationList.bachelorScienceType')"
                    prop="degreeTypeI18n"
                    show-overflow-tooltip
                ></el-table-column>
                <el-table-column :label="$t('graduationList.graduationTime')" prop="graduateTime" width="120"></el-table-column>
                <el-table-column :label="$t('graduationList.degreeTime')" prop="toDegreeTime" width="120"></el-table-column>
                <!-- <el-table-column
                    :label="$t('graduationList.auditBatch')"
                    show-overflow-tooltip
                    fixed="right"
                >
                    <template slot-scope="scope">
                        <span v-if="scope.row.reviewBatchI18n"  size="mini">{{ scope.row.reviewBatchI18n }}</span>
                        <span v-else  size="mini">{{ $t("graduationList.noPending") }}</span>
                    </template>
                </el-table-column> -->
                <el-table-column label="审核批次1" width="120" prop="reviewBatch1"></el-table-column>
                <el-table-column label="审核批次2" width="120" prop="reviewBatch2"></el-table-column>
                <el-table-column :label="$t('graduationList.isEffective')">
                    <template slot-scope="scope">
                        <span v-if="scope.row.isValidity == 1" size="mini">
                            {{ $t('graduationList.yes') }}
                        </span>
                        <span v-if="scope.row.isValidity == 0" size="mini">
                            {{ $t('graduationList.no') }}
                        </span>
                    </template>
                </el-table-column>
                <el-table-column :label="$t('graduationList.submissionStatus')" fixed="right">
                    <template slot-scope="scope">
                        <el-tag v-if="scope.row.submit == 1" type="success" size="mini">
                            {{ $t('graduationList.submitted') }}
                        </el-tag>
                        <el-tag v-if="scope.row.submit == 2" type="warning" size="mini">
                            {{ $t('graduationList.returned') }}
                        </el-tag>
                        <el-tag v-if="scope.row.submit == 0 || scope.row.submit == 3" type="danger" size="mini">
                            {{ $t('graduationList.unsubmitted') }}
                        </el-tag>
                    </template>
                </el-table-column>
                <edu-table-column :label="$t('common.text.operation')" width="140" v-if="role == 4">
                    <template slot-scope="scope">
                        <el-button type="text" size="mini" @click.stop="handleClick('editRecord', scope.row)">{{$t('common.btn.edit')}}</el-button>
                        <el-button type="text" size="mini" @click.stop="handleClick('deleteRecord', scope.row)">{{$t('common.btn.delete')}}</el-button>
                        <el-button v-if="scope.row.isValidity == 1 && scope.row.submit == 1" type="text" size="mini" @click="handleClick('WAC', scope.row)">
                            退回
                        </el-button>
                    </template>
                </edu-table-column>
            </EduTable>
        </el-card>
        <div v-if="studentDialog.add.show">
            <add-student :show.sync='studentDialog.add.show' :sendData='studentDialog.sendData'></add-student>
        </div>
        <div v-if="studentDialog.edit.show">
            <edit-student :show.sync='studentDialog.edit.show' :sendData='studentDialog.sendData'></edit-student>
        </div>
        <edu-dialog
            :title="dialog.title"
            :visible.sync="dialog.visible"
            size="small"
            :autoHeight="true"
            @close="dialogClose"
            @confirm="confirm"
        >
            <el-form
                v-if="dialog.mode !== 'WAC'"
                ref="dialogForm"
                :model="dialog.attachParams"
                :rules="mechineRules"
                label-position="right"
                label-width="120px"
                size="small"
            >
                <el-row v-if="dialog.mode === 'SIE'">
                    <el-col :span="19">
                        <el-form-item label="是否有效" prop="isValidity">
                            <el-select v-model="dialog.attachParams.isValidity" style="width: 100%">
                                <el-option
                                    v-for="item in options.validityList"
                                    :key="item.value"
                                    :label="item.label"
                                    :value="item.value"
                                />
                            </el-select>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row v-if="dialog.mode == 'EMF'">
                    <el-col :span="19">
                        <el-form-item label="文件类型" prop="fileType">
                            <el-select v-model="dialog.attachParams.fileType" style="width: 100%">
                                <template v-for="item in options.fileType">
                                     <el-option
                                        :key="item.value"
                                        :label="item.label"
                                        :value="item.value"
                                        v-if="!(role == 3 && item.value != 1)"
                                    />
                                </template>
                            </el-select>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row v-if=" dialog.mode == 'EGRJ' 
                            || dialog.mode == 'EGRX' 
                            || dialog.mode == 'PRF' 
                            || dialog.mode == 'SCN' 
                            || dialog.mode == 'SMCN' 
                            || dialog.mode == 'EMF' 
                            || dialog.mode == 'BSR' 
                            || dialog.mode == 'EPC'">
                    <el-col :span="19">
                        <el-form-item :label="$t('graduationList.compeleteGraduationYear')" prop="graduationDate">   
                            <el-date-picker
                                v-model="dialog.attachParams.graduationDate"
                                type="year"
                                style="width:100%"
                                value-format="yyyy"
                                @change="dialogGraduationDateChange"
                                :placeholder="$t('graduationList.pleaseSelect')">
                            </el-date-picker>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row v-if="dialog.mode == 'EOF' || dialog.mode == 'EPC' || dialog.mode == 'PRF'">
                    <el-col :span="19">
                        <el-form-item :label="$t('label.college')" prop="faculty">
                            <el-select
                                v-model="dialog.attachParams.faculty"
                                @change="getDialogMajorOptions"
                                style="width: 100%;"
                                clearable
                                filterable
                            >
                                <el-option
                                    v-if="dialog.mode == 'EPC' || dialog.mode == 'PRF'"
                                    key="0"
                                    label="全部"
                                    value="0"
                                />
                                <el-option
                                    v-for="item in extraParam.faculty"
                                    :key="item.value"
                                    :label="item.label"
                                    :value="item.value"
                                />
                            </el-select>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row v-if="dialog.mode == 'EPC'">
                    <el-col :span="19">
                        <el-form-item  :label="$t('label.major') + ':'"  prop="profession">
                            <el-select v-model="dialog.attachParams.profession" style="width: 100%">
                                 <template v-if="dialog.mode == 'EPC'">
                                    <el-option
                                        v-if="dialog.mode == 'EPC'"
                                        key="0"
                                        label="全部"
                                        value="0"
                                    />
                                     <el-option
                                        v-for="item in ministryEduOption"
                                        :key="item.value"
                                        :label="item.label"
                                        :value="item.value"
                                    />
                                </template>
                                <template v-else>
                                    <el-option
                                        v-for="item in options.dialogProfession"
                                        :key="item.value"
                                        :label="item.label"
                                        :value="item.value"
                                    />
                                </template>
                            </el-select>
                        </el-form-item>
                    </el-col>
                </el-row>     
                <el-row v-if=" dialog.mode == 'EGRJ' ||
                            dialog.mode == 'EGRX' ||
                            dialog.mode == 'PRF' ||
                            dialog.mode == 'SCN' ||
                            dialog.mode == 'SMCN' ||
                            dialog.mode == 'EMF' ||
                            dialog.mode == 'BSDR' ||
                            dialog.mode == 'BSR' ||
                            dialog.mode == 'EPC'">
                    <el-col :span="19">
                        <el-form-item :label="$t('graduationList.auditBatch')" prop="reviewBatch">
                            <el-select v-model="dialog.attachParams.reviewBatch" style="width: 100%">
                                <el-option
                                    key="6"
                                    label="全部"
                                    value="6"
                                />
                                <el-option
                                    v-for="item in options.dialogReviewBatch"
                                    :key="item.value"
                                    :label="item.label"
                                    :value="item.value"
                                />
                            </el-select>
                        </el-form-item>
                    </el-col>
                </el-row>    
                <el-row v-if="dialog.mode == 'BSR' ||
                        dialog.mode == 'EPC' ||
                        dialog.attachParams.fileType == 3">
                    <el-col :span="19">
                        <el-form-item :label="$t('culturePlan.degreeType')" prop="degreeType">
                            <el-select v-model="dialog.attachParams.degreeType" style="width: 100%">
                                <el-option
                                    v-if="dialog.mode != 'EPC' && dialog.mode != 'BSR' && dialog.mode != 'EMF'"
                                    key="0"
                                    label="全部"
                                    value="0"
                                />
                                <el-option
                                    v-for="item in options.degreeType"
                                    :key="item.value"
                                    :label="item.label"
                                    :value="item.value"
                                    v-if='item.value != 3'
                                ></el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row v-if="dialog.mode === 'EGRX' || dialog.mode === 'EMF' && dialog.attachParams.fileType == 2">
                    <el-col :span="19">
                        <el-form-item :label="$t('graduationList.exportFormat')">
                            <el-radio-group v-model="dialog.attachParams.exportFileType">
                                <el-radio label="1">EXCEL文件</el-radio>
                                <el-radio label="2">DBF文件</el-radio>
                            </el-radio-group>
                        </el-form-item>
                    </el-col>
                </el-row>  
            </el-form>
            <edu-table
                v-if="dialog.mode === 'WAC' || dialog.mode === 'SIE'"
                :data="dialog.dialogTableData"
                @selection-change="dialogSelectionChange"
                :pagination="false"
                :selection="dialog.mode != 'WAC'"
                :order="dialog.mode != 'WAC'"
                ref="tableDialog"
            >
                <el-table-column
                    :label="$t('graduationList.studentID')"
                    prop="studentId"
                ></el-table-column>
                <el-table-column :label="$t('graduationList.name')" prop="name"></el-table-column>
                <el-table-column
                    :label="$t('graduationList.auditConclusion')"
                >
                    <template slot-scope="scope">
                        <span v-if="scope.row.collegeAuditConclusion == 4">{{$t('graduationList.permanentClosure')}}</span>
                        <span v-else>{{scope.row.collegeAuditConclusionI18n}}</span>
                    </template>
                </el-table-column>
            </edu-table>
        </edu-dialog>
    </div>
</template>
<script>
import UTILS from 'common/src/utils/utils'
import { queryDic} from 'common/src/api/dictionary'
// import { findFaculty } from 'common/src/api/faculty'
import { findBelongBigProfessionByFaculty } from 'common/src/api/culture/bachelor'
import {
    findAllGraduateReviewBatch,
    findGraduateList,
    editCertificateNo,
    editMinorCertificateNo,
    saveReturnReviewConclusion,
    createGraduateList,
    editIsValidity,
    exportReissueCertificateListPdf,
    findFaculty
} from 'common/src/api/graduationManagement/suspendToGraduateList'
import {forMateTimeToStr, HIDE_FACULTYCODE} from '../components/gradMangeUtis';
import { getPower } from 'common/src/api/culture/culturePlan'
import manageApi from 'common/src/api/graduationManagement/graduationManage';
export default {
    name: 'graduationList',
    components: {
        addStudent: resolve => require(['../components/addStudent'], resolve),
        editStudent: resolve => require(['../components/editCompleteStudent'], resolve)
    },
    data() {
        return {
            // 筛选相关选项
            queryForm: {
                isOverseas: '0',
                grade: '', // 年级
                graduationDate: '',
                reviewBatch: '',
                faculty: '',
                profession: '',
                nation: '',
                sex: '',
                lengthSchoolingList: [],
                collegeReviewStartDate: '',
                collegeReviewEndDate: '',
                number: '',
                orginManualConclusion: '', //原学院审核结论
                collegeAuditConclusion: '',
                isValidity: '', //是否有效
                degreeType: '',
                submit: '',
                pageNum_: 1,
                pageSize_: 20,
                name: '',
                total: 0
            },
            // 下拉相关选项数据
            options: {
                graduationDate: [],
                reviewBatch: [],
                dialogReviewBatch: [],
                dialogProfession: [],
                trainingLevel: [],
                professionCateGory: [],
                faculty: [],
                profession: [],
                nation: [],
                sex: [],
                lengthSchooling: [
                    {
                        value: '0.5',
                        label: '0.5'
                    },
                    {
                        value: '1',
                        label: '1'
                    },
                    {
                        value: '1.5',
                        label: '1.5'
                    },
                    {
                        value: '2',
                        label: '2'
                    },
                    {
                        value: '2.5',
                        label: '2.5'
                    },
                    {
                        value: '3',
                        label: '3'
                    },
                    {
                        value: '3.5',
                        label: '3.5'
                    },
                    {
                        value: '4',
                        label: '4'
                    },
                    {
                        value: '4.5',
                        label: '4.5'
                    },
                    {
                        value: '5',
                        label: '5'
                    },
                    {
                        value: '5.5',
                        label: '5.5'
                    },
                    {
                        value: '6',
                        label: '6'
                    },
                    {
                        value: '7',
                        label: '7'
                    },
                    {
                        value: '8',
                        label: '8'
                    }
                ],
                collegeAuditConclusion: [],
                submit: [
                    {
                        value: '0',
                        label: '未提交'
                    },
                    {
                        value: '1',
                        label: '已提交'
                    },
                    {
                        value: '2',
                        label: '已退回'
                    }
                ],
                degreeType: [],
                validityList: [
                    {
                        value: 0,
                        label: '无效'
                    },
                    {
                        value: 1,
                        label: '有效'
                    }
                ],
                fileType: [
                {
                        value: "1",
                        label: "辅修专业证书"
                    },
                    {
                        value: "2",
                        label: "辅修专业（学信网）"
                    },
                    {
                        value: "3",
                        label: "辅修专业（学位网）"
                    },
                ]
            },
            mechineRules: {
                graduationDate: [
                    {
                        required: true,
                        message: '请选择审核年份',
                        trigger: 'change'
                    }
                ],
                reviewBatch: [
                    {
                        required: true,
                        message: '请选择审核批次',
                        trigger: 'change'
                    }
                ],
                isValidity: [
                    {
                        required: true,
                        message: '请选择',
                        trigger: 'change'
                    }
                ],
                fileType: [
                    {
                        required: true,
                        message: '请选择文件类型',
                        trigger: 'change'
                    }
                ],
                degreeType: [
                    {
                        required: true,
                        message: '请选择学位类型',
                        trigger: 'change'
                    }
                ],
                faculty: [
                    {
                        required: true,
                        message: '请选择学院',
                        trigger: 'change'
                    }
                ],
                profession: [
                    {
                        required: true,
                        message: "请选择专业",
                        trigger: "change"
                    }
                ],
            },
            tableData: [],
            multipleSelection: [],
            role: '',
            dialog: {
                mode: '',
                visible: false,
                title: '',
                tableList: [],
                dialogTableData: [],
                attachParams: {
                    isValidity: '', //是否有效
                    fileType: '', //文件类型
                    graduationDate: '', //毕业年份
                    reviewBatch: '', //审核批次
                    degreeType: '', //学位类型
                    faculty: '', //学院
                    profession: '',
                    exportFileType: ''
                }
            },
            studentDialog: {
                add: {
                    show:  false
                },
                edit: {
                    show: false
                },
                sendData: {
                    title: '新增学生'
                }
            },
            extraParam: {
                reviewDate: '',
                faculty: []
            },
            ministryEduOption: [],
            showMinorBtnInRole3: false
        }
    },
    created() {
        this.getRole()
    },
    mounted() {},
    methods: {
        async init() {
            //绑定年级
            let now = new Date()
            let currentYear = now.getFullYear() + 5,
                minYear = currentYear - 16
            for (let grade = currentYear; grade > minYear; grade--) {
                let obj = { label: grade, value: grade }
                this.options.graduationDate.push(obj)
            }
            await this.initOptions()
        },
        initOptions() {
            // findFaculty().then(res => {
            //     let data = { X_YX: res.data }
            //     UTILS.fillSelect({ faculty: 'X_YX' }, data, this.options)
            //     this.options.faculty = this.options.faculty.filter(item => {
            //         return (HIDE_FACULTYCODE || []).indexOf(item.value) === -1;
            //     })
            //     if (this.role == 3) {
            //         this.queryForm.faculty = this.options.faculty[0].value
            //         this.handleSearch()
            //         this.getMajorOptions()
            //     }
            // })
            this.getFacultyList('init');
            const data = {
                lang: this.$store.getters.language || 'cn',
                type: 'allChild',
                keys: ['G_XBIE', 'X_PYLB', 'G_MZ', 'X_XWLX', 'X_BYJL']
            }
            queryDic(data).then(res => {
                if (res.code == 200) {
                    UTILS.fillSelect(
                        {
                            sex: 'G_XBIE',
                            nation: 'G_MZ',
                            trainingCategory: 'X_PYLB',
                            collegeAuditConclusion: 'X_BYJL',
                            degreeType: 'X_XWLX'
                        },
                        res.data,
                        this.options
                    )
                    this.options.collegeAuditConclusion = this.options.collegeAuditConclusion.filter(
                        item => +item.value !== 3
                    )
                }
            })
        },
        graduationDateChange(graduationDate) {
          this.getFacultyList();
          this.getReviewBatch(graduationDate);
        },
        getFacultyList(type) {
            let param = {
                graduationDate: this.queryForm.graduationDate || '',
                reviewDate: this.extraParam.reviewDate || '',
                isOverseas: this.queryForm.isOverseas
            };
            this.queryForm.faculty = '';
            this.getFaculty(this.options, param, type);
        },
        getDialogFaculty(){
            let param = {
                graduationDate: '',
                reviewDate: this.dialog.attachParams.graduationDate || '',
                isOverseas: this.queryForm.isOverseas
            };
            this.dialog.attachParams.faculty = '';
            this.getFaculty(this.extraParam, param);
        },
        getFaculty(options, param, type) {
            options = options || {};
            options.faculty = [];
            findFaculty(param).then(res => {
                let data = {
                    "X_YX": res.data
                };
                UTILS.fillSelect({
                    faculty: "X_YX"
                }, data, options);
                    options.faculty = options.faculty.filter(item => {
                        return (HIDE_FACULTYCODE || []).indexOf(item.value) === -1;
                    })
                    if (this.role == 3 && type == "init") {
                        this.queryForm.faculty = this.options.faculty[0] && this.options.faculty[0].value
                        this.handleSearch()
                        this.getMajorOptions()
                    }
                });
        },
        getRole() {
            getPower().then(res => {
                this.role = res.data.power
                let departmentCode = res.data && res.data.departmentCode || '';
                let codeExist = false, code= '000182';
                if (departmentCode.indexOf(",") !=-1){
                    const departmentCodeArr = res.data.departmentCode.split(",");
                    codeExist = departmentCodeArr.find(item => code == item);
                }else{
                    codeExist = departmentCode == code;
                }
                if (this.role == 4) {
                    this.handleSearch()
                }
                if (this.role == 3 && codeExist) {
                    this.showMinorBtnInRole3 = true;
                }
                this.init()
            })
        },
        handleSearch() {
            let params = _.cloneDeep(this.queryForm)
            Object.assign(params, {
                lengthSchooling: this.queryForm.lengthSchoolingList + ''
            })
            if (this.extraParam.reviewDate) {
                params.reviewDate = this.extraParam.reviewDate;
            }
            findGraduateList(params).then(res => {
                if (res.code == 200) {
                    this.formatEnrolDate(res.data.list)
                    this.tableData = res.data.list
                    this.queryForm.pageNum_ = res.data.pageNum_
                    this.queryForm.pageSize_ = res.data.pageSize_
                    this.queryForm.total = res.data.total_
                }
            })
        },
        formatEnrolDate(data) {
            data.forEach(item => {
                if (item.enrolDate) {
                    item.enrolDate = item.enrolDate.split(' ')[0] || ''
                }
                if (item.graduateTime) {
                    item.graduateTime = item.graduateTime.split(" ")[0];
                }
                if (item.toDegreeTime) {
                    item.toDegreeTime = item.toDegreeTime.split(" ")[0];
                }
                item.professionI18n = item.professionName || item.professionI18n;
                if (item.directionName) {
                    item.professionI18n &&  (item.professionI18n =  item.professionI18n + ` [${item.directionName}]`);
                }
            })
        },
        handleCurrentChange(val) {
            this.queryForm.pageNum_ = val.pageNum
            this.queryForm.pageSize_ = val.pageSize
            this.handleSearch()
        },
        handleSelectionChange(selection) {
            this.multipleSelection = selection
        },
        getMajorOptions() {
            this.options.profession = []
            this.queryForm.profession = '';
            if (!this.queryForm.faculty) {
                return;
            }
            findBelongBigProfessionByFaculty({
                faculty: this.queryForm.faculty,
                grade: this.queryForm.currentGrade && Number(this.queryForm.currentGrade),
                projId: '1',
                pageNum_: 1,
                pageSize_: 100
            }).then(res => {
                if (res.code == 200) {
                    let profession = res.data.list.map((item, index) => {
                        return {
                            label: item.professionName + '-' + item.professionCode,
                            value: item.professionCode
                        }
                    })
                    this.options.profession = _.uniqBy(profession, 'value');
                }
            })
        },
        dialogGraduationDateChange(graduationDate) {
            this.getDialogFaculty();
            this.getDialogReviewBatch(graduationDate);
            this.getDialogMajorOptions();
        },
        getDialogMajorOptions() {
            if (this.dialog.mode != 'EPC') {
                return;
            }
            if (this.dialog.attachParams.profession) {
                this.dialog.attachParams.profession = '';
            }
            this.options.dialogProfession = [];
            this.ministryEduOption = [];
            if (!this.dialog.attachParams.graduationDate) {
                return;
            }
            let faculty = this.dialog.attachParams.faculty;
            if (faculty == 0) {
                faculty = '';
            }
            manageApi.getProfessionByGrade({
                faculty: faculty ,
                graduateDate: this.dialog.attachParams.graduationDate,
            })
            .then(res => {
                if (res.code == 200) {
                    let data = res.data || [];
                    let ministryEduOption = [];
                    this.options.dialogProfession = data.map((item, index) => {
                        let label = item.professionCateGoryName + '-' + item.professionCateGory;
                        ministryEduOption.push({
                            label: item.professionCateGory === '03003' ?  label: (item.ministryEduCode ? (item.professionCateGoryName + '-' + item.ministryEduCode) : item.professionCateGoryName),
                            value: item.professionCateGory
                        })
                        return {
                            label,
                            value: item.professionCateGory
                        }
                    })
                    this.ministryEduOption = ministryEduOption;
                }
            });
        },
        getReviewBatch(graduationDate) {
            this.options.reviewBatch = []
            this.queryForm.reviewBatch = '';
            if (!graduationDate) {
                return;
            }
            findAllGraduateReviewBatch({
                isOverseas: '0',
                graduateData: graduationDate
            }).then(res => {
                if (res.code == 200) {
                    this.options.reviewBatch = res.data.list.map((item, index) => {
                        return {
                            label: item.reviewBatchI18n,
                            value: item.reviewBatch
                        }
                    })
                    this.options.reviewBatch.sort((x, y) => x.value - y.value);
                }
            })
        },
        getDialogReviewBatch(graduationDate){
            this.options.dialogReviewBatch = [];
            if (this.dialog.attachParams.reviewBatch) {
                this.dialog.attachParams.reviewBatch = '';
            }
            if (!graduationDate) {
                return;
            }
            let batchs = [];
            findAllGraduateReviewBatch({
                isOverseas: '0',
                graduateData: graduationDate
            })
            .then(res => {
                if (res.code == 200) {
                    batchs = res.data.list.map((item, index) => {
                        return {
                            label: item.reviewBatchI18n,
                            value: item.reviewBatch
                        }
                    })
                }
            }).finally(() =>{
                let option = [];
                let modeArr = ['EGRJ', 'EGRX', 'PRF', 'BSR'];
                if (modeArr.indexOf(this.dialog.mode) > -1) {
                    option.push({
                        label: '未审核',
                        value: '0'
                    })
                }
                this.options.dialogReviewBatch = [
                    ...option,
                    ...batchs
                ]
            })
        },
        onSubmit() {
            if (this.queryForm.collegeReviewStartDate && this.queryForm.collegeReviewEndDate) {
                let collegeReviewStartDate = forMateTimeToStr(this.queryForm.collegeReviewStartDate);
                let collegeReviewEndDate = forMateTimeToStr(this.queryForm.collegeReviewEndDate);
                if (collegeReviewStartDate > collegeReviewEndDate) {
                    this.$message({
                        type: 'warning',
                        message: '开始时间不能大于结束时间'
                    })
                    return
                }
            }
            this.queryForm.pageNum_ = 1
            this.queryForm.pageSize_ = 20
            this.handleSearch()
        },
        reset(ref) {
            if (this.role == 4) {
                this.queryForm.name = ''
                this.queryForm.pageNum_ = 1
                this.queryForm.pageSize_ = 20
                this.queryForm.lengthSchoolingList = []
                this.$refs[ref].resetFields()  
            } else {
                this.queryForm.name = ''
                this.queryForm.pageNum_ = 1
                this.queryForm.pageSize_ = 20
                this.$refs[ref].resetFields()
                this.queryForm.faculty = this.options.faculty[0].value
                this.queryForm.lengthSchoolingList = []
            }
            this.extraParam.reviewDate = '';
            this.getMajorOptions();
            this.getReviewBatch();
            this.handleSearch();
        },

        isSelected() {
            let status = this.multipleSelection.length > 0
            if (!status) this.$message({ type: 'warning', message: '请先勾选列表记录' })
            return status
        },
        assembDialog(params = {}) {
            let len = Object.keys(params).length
            let originData = {
                mode: '',
                visible: false,
                title: '',
                tableList: [],
                dialogTableData: [],
                attachParams: {}
            }
            if (len > 0) {
                Object.assign(originData, params)
            }
            for (let key in this.dialog) {
                this.dialog[key] = originData[key]
            }
        },
        dialogSelectionChange(val) {
            this.dialog.tableList = val
        },
        dialogClose() {
            this.options.dialogReviewBatch = [];
            this.$refs.dialogForm && this.$refs.dialogForm.resetFields();
            Object.assign(this.$data.dialog, this.$options.data().dialog);
        },
        //导出
        exportFile(type) {},

        handleClick(mode, data) {
            let _this = this
            let actions = {
                /**
                 * 退回审核结论
                 */
                WAC: function() {
                    let message = '';
                    if (data.submit != 1){
                         message = "仅可退回“已提交”状态的学院审核结论，请检查";
                    }
                    if (data.isValidity != 1) {
                         message = "仅可退回有效的学生";
                    }
                    if (message) {
                         _this.$message({
                            type: "warning",
                            message
                        });
                        return; 
                    }
                    _this.assembDialog({
                        mode,
                        visible: true,
                        title: '确认退回审核结论',
                        dialogTableData: [data]
                    })
                },
                /**
                 * 设置是否有效
                 */
                SIE: function() {
                    if (_this.isSelected()) {
                        _this.assembDialog({
                            mode,
                            visible: true,
                            title: '设置是否有效',
                            tableList: _this.multipleSelection,
                            dialogTableData: _this.multipleSelection
                        })
                        _this.$nextTick(function() {
                            _this.dialog.tableList.forEach(item => {
                                _this.$refs['tableDialog'] &&
                                    _this.$refs['tableDialog'].toggleRowSelection(item, true)
                            })
                        })
                    }
                },
                /**
                 * 导出结业换证（教委）
                 */
                EGRJ: function() {
                    _this.assembDialog({
                        mode,
                        visible: true,
                        title: '导出结业换证（教委）',
                        attachParams: {
                            degreeType: '0', //学位类型
                            reviewBatch: '6'
                        }
                    })
                },
                /**
                 * 导出结业换证（学信网）
                 */
                EGRX: function() {
                    _this.assembDialog({
                        mode,
                        visible: true,  
                        title: '导出结业换证（学信网）',
                        attachParams: {
                            reviewBatch: '6', //审核批次
                            degreeType: '0', //学位类型
                            exportFileType: '2' //导出文件格式
                        }
                    })
                },
                /**
                 * 打印补发证书审批单
                 */
                PRF: function() {
                    _this.assembDialog({
                        mode,
                        visible: true,
                        title: '打印补发证书审批单',
                        attachParams: {
                            reviewBatch: '6', //审核批次
                            degreeType: '0', //学位类型
                            faculty: '0'
                        }
                    })
                },
                /**
                 * 设置学位证书编号
                 */
                SCN: function() {
                    _this.assembDialog({
                        mode,
                        visible: true,
                        title: '设置学位证书编号',
                    })
                },
                /**
                 * 设置辅修专业证书编号
                 */
                SMCN: function() {
                    _this.assembDialog({
                        mode,
                        visible: true,
                        title: '设置辅修专业证书编号'
                    })
                },
                /**
                 * 导出辅修文件
                 */
                EMF: function() {
                    _this.assembDialog({
                        mode,
                        visible: true,
                        title: '导出辅修文件',
                        attachParams: {
                            reviewBatch: '6', //审核批次
                            exportFileType: '1'
                        }
                    })
                },
                /**
                 * 学位上报
                 */
                BSR: function() {
                    _this.assembDialog({
                        mode,
                        visible: true,
                        title: '学位上报',
                        attachParams: {
                            reviewBatch: '6', //审核批次
                        }
                    })
                },
                /**
                 * 导出打印学位证书
                 */
                EPC: function() {
                    _this.assembDialog({
                        mode,
                        visible: true,
                        title: '导出打印学位证书',
                        attachParams: {
                            faculty: '0', //学院
                            profession: '0', //专业
                            reviewBatch: '6', //审核批次
                        }
                    })
                },
                //新增学生
                addRecord() {
                    if (!_this.queryForm.graduationDate) {
                        _this.$message({
                                type: "warning",
                                message: "请选择原毕业年份"
                        });
                        return;
                    }
                    Object.assign(_this.studentDialog, {
                        add: {
                            show: true,
                        },
                        sendData: {
                            title: '新增结业生',
                            isNotGraduationStudent: true,
                            isOverseas: '0',
                            graduationDate: _this.queryForm.graduationDate,
                            queryApi: manageApi.completefindStudentStatusInfo,
                            addApi: manageApi.completeAddStudentInfo,
                            updateList: _this.handleSearch
                        }
                    })
                },
                deleteRecord() {
                    let msg = '确认删除吗?';
                    if (data.collegeAuditConclusion) {
                        msg = '该学生已有学院审核结论,确认是否删除?';
                    }
                    _this.$eduConfirm(msg, '删除').then((res) => {
                        manageApi.completeDeleteStudentInfo({studentIds: data.studentId}).then(res =>{
                            _this.$message({
                                message: '删除学生成功',
                                type: 'success'
                            });
                            _this.handleSearch();
                        })  
                    })
                },
                editRecord() {
                    let copyData = _.cloneDeep(data);
                    copyData.graduateTime && ( copyData.graduateTime += ' 00:00:00');
                    Object.assign(_this.studentDialog, {
                        edit: {
                            show: true,
                        },
                        sendData: {
                            title: '编辑',
                            data: copyData,
                            editApi: manageApi.completeEditStudentInfo,
                            updateList: _this.handleSearch
                        }
                    })
                }
            }
            return actions[mode]()
        },
        confirm() {
            let _this = this
            let params = {}
            let msg
            let dialog = _.cloneDeep(_this.dialog)
            if(dialog.attachParams.reviewBatch == 6){
                dialog.attachParams.reviewBatch = ''
            }
            if (dialog.attachParams.degreeType == 0) {
                dialog.attachParams.degreeType = ''
            }
            let actions = {
                /**
                 * 退回审核结论
                 */
                WAC: function() {
                    params.ids = _this.dialog.dialogTableData.map(item => item.id)
                    params.isOverseas = '0'
                    msg = '退回审核结论成功'
                    return saveReturnReviewConclusion(params)  
                },
                /**
                 * 设置有效时间
                 */
                SIE: function() {
                    params.ids = _this.dialog.tableList.map(item => item.id)
                    params.isOverseas = '0'
                    params.isValidity = _this.dialog.attachParams.isValidity
                    msg = '设置成功'
                    return editIsValidity(params)
                },
                /**
                 * 设置学位证书编号
                 */
                SCN: function() {
                    params.isOverseas = '0'
                    params.graduationDate = _this.dialog.attachParams.graduationDate
                    params.reviewBatch = _this.dialog.attachParams.reviewBatch
                    msg = '设置学位证书编号成功'
                    return editCertificateNo(params)
                },
                /**
                 * 设置辅修专业证书编号
                 */
                SMCN: function() {
                    params.isOverseas = '0'
                    params.graduationDate = _this.dialog.attachParams.graduationDate
                    params.reviewBatch = _this.dialog.attachParams.reviewBatch
                    msg = '设置辅修专业证书编号成功'
                    return editMinorCertificateNo(params)
                }
            }
            if (_this.dialog.mode == 'WAC') {
                return _this.request(actions[_this.dialog.mode](), msg)
            }
            else {
                _this.$refs['dialogForm'].validate(valid => {
                    if (valid) {
                         /**
                         * 导出结业换证(教授)
                         */
                        if(_this.dialog.mode == 'EGRJ'){
                            window.location.href = `/api/graduationservice/suspendToGraduateList/exportSecSuspendToGraduateList?graduationDate=${dialog.attachParams.graduationDate}&reviewBatch=${dialog.attachParams.reviewBatch}&isOverseas=0`;
                            _this.dialogClose()
                        } 
                        /**
                         * 导出结业换证(学信网)
                         */
                        else if(_this.dialog.mode == 'EGRX'){
                            window.location.href = `/api/graduationservice/suspendToGraduateList/exportXueXinSuspendToGraduateList?graduationDate=${dialog.attachParams.graduationDate}&reviewBatch=${dialog.attachParams.reviewBatch}&isOverseas=0&exportFileType=${dialog.attachParams.exportFileType}`;
                            _this.dialogClose()
                        }
                        /**
                         * 打印补发证书审批单
                         */
                        else if(_this.dialog.mode == 'PRF'){
                            let param = `graduationDate=${dialog.attachParams.graduationDate}&faculty=${dialog.attachParams.faculty}&reviewBatch=${dialog.attachParams.reviewBatch}&isOverseas=0`;
                            _this.printPdf(param);
                            _this.dialogClose();
                        }
                        /**
                         * 导出辅修文件
                         */
                        else if(_this.dialog.mode == 'EMF'){
                            let str = `/api/graduationservice/suspendToGraduateList/exportMinorDocuments?fileType=${dialog.attachParams.fileType}&graduationDate=${dialog.attachParams.graduationDate}&reviewBatch=${dialog.attachParams.reviewBatch}&isOverseas=0`;
                            if (dialog.attachParams.fileType == 3) {
                                str += `&degreeType=${dialog.attachParams.degreeType}`;
                            }
                            if (dialog.attachParams.fileType == 2) {
                                str += `&exportFileType=${dialog.attachParams.exportFileType}`;
                            }
                            window.location.href = str;
                            _this.dialogClose()
                        }
                        /**
                         * 学位上报
                         */
                        else if(_this.dialog.mode == 'BSR'){
                            window.location.href = `/api/graduationservice/suspendToGraduateList/exportDegreeReport?graduationDate=${dialog.attachParams.graduationDate}&reviewBatch=${dialog.attachParams.reviewBatch}&degreeType=${dialog.attachParams.degreeType}&isOverseas=0`;
                            _this.dialogClose()
                        }
                        /**
                         * 导出打印学位证书
                         */
                        else if(_this.dialog.mode == 'EPC'){
                            window.location.href = `/api/graduationservice/suspendToGraduateList/exportPrintDegreeCertificate?graduationDate=${dialog.attachParams.graduationDate}&faculty=${dialog.attachParams.faculty}&profession=${dialog.attachParams.profession}&reviewBatch=${dialog.attachParams.reviewBatch}&degreeType=${dialog.attachParams.degreeType}&isOverseas=0`
                            _this.dialogClose()
                        }else {
                            _this.request(actions[_this.dialog.mode](), msg)
                        }
                    } else {
                        return false
                    }
                })
            }
        },
        async request(api, msg) {
            let { code, data } = await api
            if (code !== 200) return
            this.dialogClose();
            this.handleSearch()
            this.$message({
                type: 'success',
                message: msg || '设置成功'
            })
        },
        async printPdf(param) {
            let {data} = await exportReissueCertificateListPdf(param);
            let url = `/api/studentservice/assessApply/previewPersonTitle?objectKey=${data}`;
            window.open(url);
        },
    }
}
</script>
<style lang="scss" scoped>
.div-main {
    margin-bottom: 16px;
}
.btn-right-list{
    .el-button+.el-button {
        margin-left: 5px;
    }
    .el-button--primary.el-button--small:not(.is-circle):not(.el-transfer__button) {
        padding: 0 8px;
    }
}
</style>

